package o;

import java.io.Reader;
import java.util.ArrayList;
import o.gcg.f;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

abstract class gco {
    protected gcd ʻॱ;
    gbz ʽ;
    private g ˊ = new g();
    gch ˊॱ;
    private i ˋ = new i();
    protected gcg ˋॱ;
    protected String ˏॱ;
    protected ArrayList<Element> ͺ;
    protected Document ॱˊ;
    protected gcb ॱॱ;

    abstract gcd ˊ();

    protected abstract boolean ˎ(gcg o_gcg);

    gco() {
    }

    protected void ˋ(Reader reader, String str, gcb o_gcb) {
        gbj.ˏ((Object) reader, "String input must not be null");
        gbj.ˏ((Object) str, "BaseURI must not be null");
        this.ॱˊ = new Document(str);
        this.ॱˊ.ॱ(o_gcb);
        this.ॱॱ = o_gcb;
        this.ʻॱ = o_gcb.ˎ();
        this.ʽ = new gbz(reader);
        this.ˋॱ = null;
        this.ˊॱ = new gch(this.ʽ, o_gcb.ˏ());
        this.ͺ = new ArrayList(32);
        this.ˏॱ = str;
    }

    Document ˊ(Reader reader, String str, gcb o_gcb) {
        ˋ(reader, str, o_gcb);
        ˊˋ();
        return this.ॱˊ;
    }

    protected void ˊˋ() {
        gcg ˎ;
        do {
            ˎ = this.ˊॱ.ˎ();
            ˎ(ˎ);
            ˎ.ˊ();
        } while (ˎ.ˎ != f.EOF);
    }

    protected boolean ॱˊ(String str) {
        if (this.ˋॱ == this.ˋ) {
            return ˎ(new i().getAttrName(str));
        }
        return ˎ(this.ˋ.ॱˊ().ˊ(str));
    }

    public boolean ˋ(String str, gbi o_gbi) {
        if (this.ˋॱ == this.ˋ) {
            return ˎ(new i().ˋ(str, o_gbi));
        }
        this.ˋ.ॱˊ();
        this.ˋ.ˋ(str, o_gbi);
        return ˎ(this.ˋ);
    }

    protected boolean ˋॱ(String str) {
        if (this.ˋॱ == this.ˊ) {
            return ˎ(new g().getAttrName(str));
        }
        return ˎ(this.ˊ.ॱˊ().ˊ(str));
    }

    protected Element ˊˊ() {
        int size = this.ͺ.size();
        return size > 0 ? (Element) this.ͺ.get(size - 1) : null;
    }
}
